import React from 'react';
import styles from './css/TodoItem.module.css'

function TodoItem({ item, index, handleItemDelete }) {
  return (
    <div className={styles.todoItem}>
      <li>
        <span>
          {index + 1}. {item}
        </span>
        <span
          className={styles.closeBtn}
          onClick={handleItemDelete.bind(this, index)}
        >
          ×
        </span>
      </li>
    </div>
  );
}

export default TodoItem;
